<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../ext/resources/css/ext-all.css"
	type="text/css"></link>
<script type="text/javascript" src="../ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../ext/ext-all.js"></script>
<script type="text/javascript">
	Ext.ns("userApp");
	Ext.onReady(function() {
		Ext.QuickTips.init();
		userApp.bigId;
		userApp.smallId;
		userApp.exam_Year;
		userApp.BigTypes = new Ext.data.JsonStore({
			url : '../public/showBigList',
			totalProperty : 'total',
			root : 'bigtypes',
			baseParams : {
				limit : 10
			},
			fields : [ {
				name : "big_Id",
				type : 'int'
			}, {
				name : "big_Name",
				type : 'string'
			} ]
		});
		userApp.smallTypes = new Ext.data.JsonStore({
			url : '../public/showSmallList',
			totalProperty : 'total',
			root : 'smalltypes',
			fields : [ {
				name : "small_Id",
				mapping : 'small_Id',
				type : 'int'
			}, {
				name : "small_Name",
				mapping : 'small_Name',
				type : 'string'
			} ]
		});// 定义点击大类型后加载相应的小类型
		userApp.bigComo = new Ext.form.ComboBox({
			id : 'userApp_BigComob',
			renderTo : 'combo1',
			msgTarget : 'qtip',
			allowBlank : false,
			blankText : '对不起，请选择状态栏！',
			emptyText : '请选择考试类型',
			mode : 'remote',
			triggerAction : 'all',
			valueField : 'big_Id',
			displayField : 'big_Name',
			store : userApp.BigTypes
		});
		userApp.smallComo = new Ext.form.ComboBox({
			id : 'userApp_SmallComob',
			renderTo : 'combo2',
			msgTarget : 'qtip',
			allowBlank : false,
			blankText : '对不起，请选择状态栏！',
			emptyText : '请选择考试具体选项',
			mode : 'local',
			triggerAction : 'all',
			valueField : 'small_Id',
			displayField : 'small_Name',
			store : userApp.smallTypes
		});
		userApp.yearSelect = new Ext.form.DateField({
			id : 'userApp_yearSelect',
			renderTo : 'comb3',
			msgTarget : 'qtip',
			allowBlank : false,
			format : 'Y',
			width : 150,
			name : 'exam_Year'
		});
		Ext.getCmp("userApp_BigComob").on('select', function(combo) {
			userApp.smallTypes.load({
				params : {
					big_Id : combo.getValue(),
					limit : 10
				}
			});
		});
		Ext.getCmp("userApp_SmallComob").on('select', function(combo) {
			//small_Id = 
			document.getElementById("small_Id").value = combo.getValue();
		});
	});
</script>
</head>
<body>
	<div class="left2">
		<div class="wenti2">
			<div class="box5">
				<div class="prot1">
					<div class="port2">
						<font color="red">
							<h4 align="center">当前关键字</h4>
							<table>
								<tr height="10">
									<td>考试名称：</td>
									<td><s:if test="exam_Name==null"></s:if><s:else>${exam_Name}</s:else></td>
								</tr>
								<tr height="10">
									<td>所属类型：</td>
									<td><s:if test="small_Id==0"></s:if><s:else>${userApp_SmallComob}</s:else></td>
								</tr>
								<tr height="10">
									<td>考试年度：</td>
									<td><s:if test="exam_Year==0"></s:if><s:else>${exam_Year}</s:else></td>
								</tr>
								<tr height="10">
									<td>考试状态：</td>
									<td><s:if test="exam_status==null"></s:if><s:elseif test="exam_status==-1">无条件查询</s:elseif><s:elseif test="exam_status==1">可报名</s:elseif><s:elseif test="exam_status==4">可领取考证</s:elseif></td>
								</tr>
							</table>
						</font>
						<h2 class="title3">查询关键字</h2>
						<s:form id="appForm" action="searchExamWithConditions"
							method="post">
							<table>
								<tr height="30">
									<td>考试名称：</td>
									<td><s:textfield name="exam_Name" /></td>
								</tr>
								<tr height="30">
									<td>所属类型：</td>
									<td><span id="combo1"></span><span id="combo2"></span> <input
										type="hidden" id="small_Id" name="small_Id" />
									</td>
								</tr>
								<tr height="30">
									<td>考试年度：</td>
									<td><span id='comb3'></span></td>
								</tr>
								<tr height="30">
									<td>考试状态：</td>
									<td><s:select name="exam_status "
											list="#{-1:'无条件',1:'可报名',4:'可领取考证'}" /></td>
								</tr>
							</table>
							<p align="center">
								<input type="submit" value="查询">
							</p>
						</s:form>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>